Skip to main content

All Questions

Tagged with
2votes
1answer
754views

C Macro based OOP

I come from an OOP background, and have recently delved into C and embedded systems. As an exercise I wanted to see if I could wrap some OOP concepts into a macro header. It works as I intended, is ...
E R Barratt's user avatar
8votes
2answers
282views

Tron game on Wii / GameCube

I implemented the following Tron cycle game so that it can be run on GameCube / Wii devices (quarantine...). Indeed, there exist many tools (I rely on devkitPPC) and I thought a Tron game would be an ...
RUser4512's user avatar
2votes
1answer
76views

Struct data masking

I have an interface under development using an object-based approach. Objects should be statically allocated by the application writer (Dynamic memory allocation is not allowed). I want to obfuscate ...
P.S.'s user avatar
3votes
2answers
755views

Implementation of tree with different node types and faux-polymorphism in C

I'm currently learning C by working on my first project. It's a calculator with a parser that transforms input into an operator tree. These trees consist of nodes of different types: Operators (inner ...
PhilippHochmann's user avatar
1vote
1answer
213views

Polymorphism and inheritance in C99

In the following code I have created the something like the behavior of inheritance and methods in C99 (without vtable). The code compiles without any warnings even with ...
Lin's user avatar
  • 295
0votes
1answer
148views

Drawing various types of shapes [closed]

I did the following Excercise: simulate single inheritance in C. Let each "base class" contain a pointer to an array of pointers to functions (to simulate virtual functions as freestanding ...
Sandro4912's user avatar
6votes
2answers
323views

Dynamically sized queue

This is my first deep dive into C, and I want to make sure that I'm not doing anything stupid. The code below creates an "Array List" of sorts, which automatically resizes itself. This code is meant ...
t3ddftw's user avatar
6votes
2answers
915views

Mimicking classes with structs in C

I'm trying to mimic classes. Is there anything with this code that I should not do with C or any ways that I can improve it at all, such as best practices or anything? structs.h ...
izzzi's user avatar
2votes
1answer
314views

Parser Combinators in OO C

In trying to understand and use the Parser Combinator concept, I've coded up as close an analogue as I could manage within the constraints of the C language. C doesn't have first-class functions or ...
luser droog's user avatar
2votes
1answer
107views

Wrapping messages into common header, ANSI C

I have a protocol where I send lots of different messages using two or three different header types (let's call them "Type A" and "Type B" messages). To simplify unit testing, my idea was to do ...
vgru's user avatar
  • 1,398
-7votes
1answer
410views

Word frequency counter - symbol table - array implementation

Symbol table It is key-value pair abstraction Insert a value with specified key Given a key, search for the corresponding value Here is the design for symbol table implementation for frequency ...
overexchange's user avatar
1vote
1answer
155views

List interface implementation

After following the comment from greybeard, Below is the design for given first phase of implementation, Code directory structure: ...
overexchange's user avatar
2votes
1answer
2kviews

Priority queue implementation using unsorted and sorted array

Below is the unsorted array and sorted array implementation of priority queue. Code directory structure: ...
overexchange's user avatar
0votes
1answer
174views

Mergesort - Database

Code directory structure: ...
overexchange's user avatar
3votes
1answer
115views

List abstraction using array

Following this reference, below is the list abstraction implementation using array, ...
overexchange's user avatar

153050per page
close